<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            list-style: none;
        }
        .container{
            margin-top: 100px;
            display: flex;
            height: 500px;
            /* 内容对齐（justify-content）属性应用在弹性容器上，把弹性项沿着弹性容器的主轴线（main axis）对齐。 
            该操作发生在弹性长度以及自动边距被确定后。 它用来在存在剩余空间时如何加以分配，也会在发生内容溢出时影响项目的对齐。 */
            justify-content: center;
            /* 居中对齐弹性盒的各项 <div> 元素： */
            align-items: center;
            margin:  0 auto;
            /* background-color: red; */
        }
        .rate-content{
            display: flex;
            /* 让弹性盒的元素以相反的顺序显示，且在必要的时候进行拆行： */
            flex-flow: row-reverse;
            margin: 0 auto;
        }
        input{
            -webkit-appearance: none;
            border: none;
            outline: none;
            cursor: pointer;
        }
        input[class="rate"]{
            font-size: 50px;
            padding-right: 20px;
            transition: transform 0.2s ease;
        }
        input[class="rate"]:hover{
            transform: scale(1.2);
        }
        input[class="rate"]:hover::after{
            content: "★";
            color: #ffa822;
        }
        input[class="rate"]::after{
            content: "☆";
            color: #999;
            transition: color 0.4s ease;

        }
        
        input[class="rate"]:checked::after{
            content: "★";
            color: #ffa822;
        }
        input[class="rate"]:checked~input[class="rate"]::after{
            content: "★";
            color: #ffa822;
        }
    </style>
</head>
<body>
    <!-- css五星评分 -->
    <div class="container">
        <div class="rate-content">
            <input type="radio" class="rate">
            <input type="radio" class="rate">
            <input type="radio" class="rate">
            <input type="radio" class="rate">
            <input type="radio" class="rate">
        </div>
    </div>
    
</body>
</html>